# import collections
# class Solution(object):
#     def findCriticalAndPseudoCriticalEdges(self, n, edges):
#         d = collections.defaultdict(set)
#         for u, v, _ in edges:
#             d[u].add(v)
#             d[v].add(u)
#         self.time = 0
#         node_st = []
#         time_st = [-1] * n
#         groups = []
#         def dfs(last_node, node):            
#             time_st[node] = self.time
#             self.time += 1
#             node_st.append(node)
#             next_time = self.time
#             for v in d[node]:
#                 if v != last_node:
#                     if time_st[v] == -1:
#                         next_time = min(next_time, dfs(node, v))
#                     else:
#                         next_time = min(next_time, time_st[v])
#             if next_time == time_st[node]:
#                 a_list = []
#                 while node_st:
#                     v = node_st.pop()
#                     a_list.append(v)
#                     if v == node:
#                         break
#                 groups.append(a_list)
#             time_st[node] = min(time_st[node], next_time)
#             return time_st[node]
#         dfs(-1, 0)
#         p = [-1] * n
#         for index, group in enumerate(groups):
#             for node in group:
#                 p[node] = index
#         ans_key = []
#         ans_not_key = []
#         p_edge = collections.defaultdict(list)
#         for index, (u, v, dist) in enumerate(edges):
#             if p[u] != p[v]:
#                 ans_key.append(index)
#             else:
#                 p_edge[p[u]].append([dist, index, u, v])
#         for key, edge_list in p_edge.items():
#             edge_list.sort()
#             already_set = set()
#             target_count = collections.defaultdict(int)
#             source_count = collections.defaultdict(list)
#             for dist, index, u, v in edge_list:
#                 if u not in already_set or v not in already_set:
#                     target_count[dist] += 1
#                     already_set.add(u)
#                     already_set.add(v)
#                 source_count[dist].append[index]
#             for key in target_count:
#                 if len(source_count[key]) == target_count[key]:
#                     ans_key += source_count[key]
#                 else:
#                     ans_not_key += source_count[key]    
import collections
class Solution(object):
    def findCriticalAndPseudoCriticalEdges(self, n, edges):
        d = collections.defaultdict(list)
        for index, (u, v, dist) in enumerate(edges):
            d[dist].append([u, v, index])
        key_list = list(d.keys())
        key_list.sort()
        ans1 = []
        ans2 = []
        p = [i for i in range(n)]
        now_edges = 
        for key in key_list:
            edge_list = d[key]

                    




        
data = Solution()
n = 5
edges = [[0,1,1],[1,2,1],[2,3,2],[0,3,2],[0,4,3],[3,4,3],[1,4,6]]
print(data.findCriticalAndPseudoCriticalEdges(n, edges))